//
//  LibMadGTD.m
//  LibMadGTD. The library to include common feature of MadGTD. It's used
//  for both lite and standard versions.
//
//  Created by Fuzhou Chen on 4/22/12.
//  Copyright (c) 2012 dummydigit.net. All rights reserved.
//

#import "LibMadGTD.h"

@implementation MadAppUI

-(void)dealloc
{
    [super dealloc];
    if (_mainViewController)
        [_mainViewController release];
    if (_model)
         [_model release];
    if (_window)
        [_window release];
}

- (id)initWithWindow: (UIWindow*)window
{
    assert(window != nil); // This is fine because the library is not published.
    self = [super init];
    if (self) {
        _model = [[MadGTDModel alloc] initWithDbInDocuments:@"mad.db"];
        _mainViewController = [[MadMainViewController alloc] initWithGTDModel:_model];
        _window = [window retain];
        _window.rootViewController = _mainViewController;
    }
    return self;
}



@end
